// https://leetcode.cn/problems/minimum-value-to-get-positive-step-by-step-sum/
// Created by ade on 2022/8/9.
//

class Solution {
public:
    int minStartValue(vector<int> &nums) {
        int minNum = 0;
        int sum = 0;
        for (auto i : nums) {
            sum += i;
            minNum = min(sum, minNum);
        }
        if (minNum < 0) return -1 * minNum + 1;
        return 1;
    }
};

int main() {

}